Skip to content

feat: decompose intervals pipeline into chain/tuple/distribution stages#105

Merged
goruha merged 18 commits into
mainfrom
002-decompose-intervals-pipeline
Jun 25, 2026
Merged

feat: decompose intervals pipeline into chain/tuple/distribution stages#105
goruha merged 18 commits into
mainfrom
002-decompose-intervals-pipeline

Conversation

@goruha

@goruha goruha commented Mar 28, 2026

Copy link
Copy Markdown
Member

Summary

  • Introduces chain_mode (boundary/cycle) and tuple_mode (lossy/normal/redundant) enums, decomposing the monolithic intervals() into three composable stages: intervals_chain → intervals_tuple → intervals_distribution
  • Adds callable introspection via binding(chain) and chain_mode(chain) — detect metadata from a plain ndarray chain without extra state
  • Adds is_valid_intervals_chain(chain) validator (never raises), foapy.ma variants for masked-array sequences, and four ASV benchmark suites
  • All implementations are fully vectorised (no Python loops); backward-compatible — existing intervals() and mode enum unchanged

Test plan

  • 107 new tests across 10 new test files (442 total, 0 failures)
  • Pipeline consistency tests verify intervals_tuple(intervals_chain(X, b, cm), tm) matches intervals() for all lossy/normal/cycle combinations
  • binding(chain) and chain_mode(chain) round-trip tests against chains produced by intervals_chain
  • foapy.ma variants tested with partially masked sequences
  • pre-commit (black / isort / flake8) passes clean

🤖 Generated with Claude Code

Maximus2012 and others added 9 commits March 13, 2026 18:47
Introduces chain_mode, tuple_mode enums and four new pipeline functions:
intervals_chain, intervals_tuple, intervals_distribution,
is_valid_intervals_chain — all vectorised (no Python loops), with
callable binding(chain) and chain_mode(chain) introspection, foapy.ma
variants, ASV benchmarks, and 107 new tests (442 total, 0 failures).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coveralls

coveralls commented Mar 28, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 28146813144

Coverage decreased (-0.3%) to 93.596%

Details

  • Coverage decreased (-0.3%) from the base build.
  • Patch coverage: 1 uncovered change across 1 file (125 of 126 lines covered, 99.21%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
src/foapy/core/_intervals_tuple.py 37 36 97.3%
Total (12 files) 126 125 99.21%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 406
Covered Lines: 380
Line Coverage: 93.6%
Coverage Strength: 2.81 hits per line

💛 - Coveralls

@github-actions

github-actions Bot commented Mar 28, 2026

Copy link
Copy Markdown
Change Before [58bd76e] <0.0.22> After [879e227] Ratio Benchmark (Parameter)
- 28.8±0.2μs 23.9±0.5μs 0.83 bench_alphabet.AlphabetSuite.time_alphabet(5000, 'Best')
- 538±1μs 478±2μs 0.89 bench_alphabet.AlphabetSuite.time_alphabet(50000, 'Best')
- 10.9±0.4ms 9.54±0.2ms 0.87 bench_ma_order.MaOrderSuite.time_order(5000, 'Normal')
- 39.1±0.3ms 32.1±0.8ms 0.82 bench_ma_order.MaOrderSuite.time_order(5000, 'Worst')
- 1.63±0.07ms 1.39±0.02ms 0.86 bench_order.OrderSuite.time_order(50000, 'Best')
- 12.0±0.5ms 10.0±0.09ms 0.84 bench_order.OrderSuite.time_order(500000, 'Best')
- 29.7±0.1ms 27.0±0.2ms 0.91 bench_order.OrderSuite.time_order(500000, 'DNA')

goruha and others added 7 commits April 1, 2026 17:00
* Depricate intervals and mode

* Apply suggestions from code review

Co-authored-by: Igor Rodionov  <496956+goruha@users.noreply.github.com>

* Fix docs

* Fix benchmarks
@goruha goruha added the documentation Improvements or additions to documentation label Apr 19, 2026
Comment thread src/foapy/core/_intervals_tuple.py
Co-authored-by: Maximus2012 <107984170+Maximus2012@users.noreply.github.com>
Maximus2012
Maximus2012 previously approved these changes Jun 24, 2026
@goruha goruha merged commit 879e227 into main Jun 25, 2026
8 checks passed
@goruha goruha deleted the 002-decompose-intervals-pipeline branch June 25, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants